package cn.woniu.clh.service.impl;





import cn.woniu.clh.entity.Users;
import cn.woniu.clh.mapper.UserMapper;
import cn.woniu.clh.service.UserService;
import cn.woniu.clh.util.ResponseResult;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public  class UserServiceImpl extends ServiceImpl<UserMapper, Users> implements UserService {

    @Autowired(required = false)
    private UserMapper userMapper;


    @Override
    public ResponseResult<?> queryAllUserByName(String userName) {
        return new ResponseResult<>().ok(userMapper.queryAllUserByName(userName));
    }

    @Override
    public ResponseResult<?> deleteUserById(Integer id) {
        return new ResponseResult<>().ok(userMapper.deleteUserById(id));
    }

    @Override
    public ResponseResult<?> updateUserAuth(Users users) {
        return new ResponseResult<>().ok(userMapper.updateUserAuth(users));
    }

    @Override
    public ResponseResult<?> queryAllJob() {
        return new ResponseResult<>().ok(userMapper.selectJob());
    }

    @Override
    public ResponseResult<?> addUsers(Users users) {
        return new ResponseResult<>().ok(userMapper.insertUser(users));
    }

    @Override
    public ResponseResult<?> queryJobIdByAccount(String account) {
        return new ResponseResult<>().ok(userMapper.queryJobIdByAccount(account));
    }

    @Override
    public ResponseResult<?> queryUserByAccountMy(String account) {
        return new ResponseResult<>().ok(userMapper.queryUserByAccountMy(account));
    }

    @Override
    public ResponseResult<?> updateUserByAccountMy(Users users) {
        return new ResponseResult<>().ok(userMapper.updateUserByAccountMy(users));
    }

    @Override
    public ResponseResult<?> selectIdByAccount(String account) {
        return new ResponseResult<>().ok(userMapper.selectIdByAccount(account));
    }


}
